import java.util.Scanner;
import java.util.Random;

public class swich {
    public static void main3(String[] args) {
        //求1到100之间，所有既能被3整除，又能被6整除的数字
        for (int i = 1; i <= 100; i++) {
            if (i % 3 == 0) {
                if (i % 6 == 0) {
                    System.out.println(i);
                    i++;
                    continue;
                }
            }
        }
    }

    public static void main1(String[] args) {
        int a = 9;
        int count = 0;
        long num = 0;
        long sum = 0;
        for (int i = 1; i <= 10; i++) {
            num = 10 * num + 9;
            sum += num;
        }
        System.out.println(sum);
    }

    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //提示用户输入一个正整数N
        System.out.println("请输入一个正整数N：");
        int N = scanner.nextInt();
        int sum = 0;//用于存储累加结果
        //使用for循环计算1到N的总和
        for (int i = 1; i <= N; i++) {
            sum += i;

        }
        System.out.println("从1到+N+的总和是；+sum");
        scanner.close();
    }

    public static void main4(String[] args) {
        int count = 0;
        for (int i = 1; i <= 100; i++) {
            if ((i - 9) % 10 == 0) {
                System.out.println(i);
                count++;
            }
        }
        System.out.println("数字9输出的次数为" + count + "次");
    }


    public static void main5(String[] args) {
        int a = 0;
        int count = 0;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字");
        int num = sc.nextInt();
        for (int i = 2; i < num; i++) {
            if (num % i == 0) {
                count++;
                continue;
            }
        }
        if (count > 0) {
            System.out.println("数字" + num + "不是素数");
        } else {
            System.out.println("数字" + num + "是素数");
        }
    }

    //求水仙花数
//心路历程：
// i%10得出个位 g
//i%100得出十位和个位 m 减去g并除以10得出十位 s
//百位就是该数字i减去十位和个位m再除以100 b
    public static void main0(String[] args) {
        int n = 1000;
        int g = 0;
        int b = 0;
        int s = 0;
        int m = 0;
        int i = 100;
        while (i < 1000) {
            g = i % 10;
            m = i % 100;
            s = (m - g) / 10;
            b = (i - m) / 100;
            if (i == g * g * g + s * s * s + b * b * b) {
                System.out.println("数字" + i + "是水仙花数");
                i++;
            } else
                i++;
        }
    }

    public static void main6(String[] args) {
        int g = 0;
        int b = 0;
        int s = 0;
        int m = 0;
        Scanner sc = new Scanner(System.in);
        int i = sc.nextInt();
        g = i % 10;
        m = i % 100;
        s = (m - g) / 10;
        b = (i - m) % 100;
        System.out.println(g);
        System.out.println(s);
        System.out.println(b);
    }

    //猜数字游戏
    public static void main8(String[] args) {
        int flag = 0;
        Random random = new Random();
        int num = random.nextInt(1000);
        do {
            Scanner sc = new Scanner(System.in);
            int i = sc.nextInt();

            if (i > num) {
                System.out.println("猜大了");
            }
            if (i < num) {
                System.out.println("猜小了");
            }
            if (i == num) {
                System.out.println("恭喜您猜对了!");
                flag++;
            }

        } while (flag == 0);
    }

    //图形打印
    public static void main10(String[] args) {
        int t = 0;
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        //每一列的打印
        for (int b = 0; b < n; b++) {

            //每一行的打印
            for (int a = 0; a <= n; a++) {
                if (a == 0) {
                    System.out.print("*");
                } else if (a == n - 1) {
                    System.out.println("*");
                } else
                    System.out.print(" ");
            }
            n -= 2;
            t++;

        }
    }

    //图形打印
    public static void main11(String[] args) {
        int t = 0;
        int m = 0;
        int t1 = 0;
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int num = n;
        //图形的每一列打印
        for (int b = 0; b < n; b++) {
            //图形的每一行打印
            for (int a = 0; a <= n; a++) {
                if (a == 0) {
                    System.out.print("*");
                } else if (a == n - 1) {
                    System.out.print("*");
                } else System.out.print(" ");
                t++;
                if (t == n) {
                    System.out.printf("\n");
                }
            }
            t1++;
            if (t1 > 0) {
                System.out.print(" ");
            }
            if (t == (num / 2) + 1) {
                System.out.println(" *");
            }
        }

    }

    public static void main12(String[] args) {
        String str1="*";
        String str2=" ";
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        for (int i = 1; i <n; i++) {


        }


    }

    //输入三次密码
    public static void main13(String[] args) {
        int S_number=666;
        int t=0;
        Scanner in=new Scanner(System.in);
        for (int i = 0; i < 10; i++) {
            if(t==3){
                System.out.println("次数耗尽");
                break;
            }

                System.out.println("请输入密码：");
            int num=in.nextInt();
            if(num==S_number){
                System.out.println("密码正确 验证通过");
                break;
            }
            t++;

        }


    }

    //三位数输出
    public static void main14(String[] args) {
        Scanner in=new Scanner(System.in);
        int g=0;
        int s=0;
        int b=0;
        int gs=0;
        System.out.println("请输入一个三位数");
        int n=in.nextInt();
        gs=n%100;
        g=gs%10;
        s=(gs-g)/10;
        b=(n-gs)/100;
        System.out.println(+n+"的每一位是"+b+","+s+","+g);

    }


}


